package com.ledim.chat.model;

/*
struct Header{
    uint16 cmd; //协议类型，命令ID,定义规则：奇数是请求，偶数是应答
    uint16 flag; //校验码
    uint32 len; //消息body长度
    uint32 from; //发送者连接sessionID
    uint32 to; //目标者sessionID
    uint32 sequence; //消息序列号
    uint16 mid; //内部通信时的模块ID
    uint16 version; //版本
}
*/
public class MessageHeader {

    /** 客户端请求心跳 **/
    public static final int CMD_PING = 0x0001;
    /** 心跳应答 **/
    public static final int CMD_PONG = 0x0002;
    /** 向xnet订阅消息类型 **/
    public static final int CMD_SUB = 0x0003;
    /** 订阅应答 **/
    public static final int CMD_SUB_ACK = 0x0004;
    /** 接入模块心跳上报给presence **/
    public static final int CMD_AN_HB = 0x0005;
    public static final int CMD_AN_HB_ACK = 0x0006;
    /** 客户端短心跳 **/
    public static final int CMD_SHORT_PING = 0x0007;
    /** 短心跳应答 **/
    public static final int CMD_SHORT_PONG = 0x0008;
    /** 加入聊天室 **/
    public static final int CMD_JOIN = 0x0105;
    /** 加入聊天室应答 **/
    public static final int CMD_JOIN_ACK = 0x0106;
    /** 退出聊天室 **/
    public static final int CMD_UNJOIN = 0x0107;
    /** 退出聊天室应答 **/
    public static final int CMD_UNJOIN_ACK = 0x0108;
    /** 聊天室消息 **/
    public static final int CMD_ROOM_MSG = 0x0401;
    /** 聊天室人数消息 **/
    public static final int CMD_ROOM_USERNUMBER = 0x0409;
    /** 用户被踢出 **/
    public static final int CMD_USER_KICKOFF = 0x0505;
    /** 用户被禁言 **/
    public static final int CMD_USER_SILENT = 0x0509;
    /** 用户被解除禁言 **/
    public static final int CMD_USER_UNSILENT = 0x0603;
    /** struct Header长度 **/
    public static final int LENGTH = 24;

    public int cmd;
    public int flag;
    public int len;
    public int from;
    public int to;
    public int sequence;
    public int mid;
    public int version;
}
